Spanking doesn't teach anything. Explaining and communicating does.
Spanking pushes the relationship between parent and child towards a fear based obedience. I prefer to actually communicate with my child, and for that she needs to trust me. She also shouldn't be afraid of telling me anything.
Spanking shows a child how violence to set things straight is acceptable. The same thing we tell them not to do to their peers, we'd do to them? How is overpowering a smaller person with physical force okay for punishment? To acutely protect them from harm, yes that makes sense. But after you stopped them from killing themselves, the spanking serves no educational goal.
I prefer to see my child as an autonomous individual, that deserves as much respect as I do. I try to teach empathy to both her and me. Spanking has no place in that.
FWIW this doesn't mean it's easy....but parenting isn't easy anyway.